//
//  HXDRandomColor.swift
//  weibo
//
//  Created by huxuedong on 15/12/5.
//  Copyright © 2015年 huxuedong. All rights reserved.
//

import UIKit

let kScreenW = UIScreen.mainScreen().bounds.width
let kScreenH = UIScreen.mainScreen().bounds.height

func RGB(red red: CGFloat, green: CGFloat, blue: CGFloat) -> UIColor {
    return UIColor(red: red / 255, green: green / 255 , blue: blue / 255, alpha: 1)
}

func RandomColor() -> UIColor {
    return RGB(red: CGFloat(random() % 256), green: CGFloat(random() % 256), blue: CGFloat(random() % 256))
}

//自定义打印格式
func printLog(message: Any, file: String = __FILE__, line: Int = __LINE__, method: String = __FUNCTION__) {
    #if DEBUG
        print("\((file as NSString).lastPathComponent)[\(line)], \(method): \(message)")
    #endif
}
